import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();

        int[] arr1 = new int[n+1];
        int[] arr2 = new int[m+1];
        int[][] arr2_index = new int[m+1][2];

        for (int i = 1; i <= n; i++) {
            arr1[i] = sc.nextInt();
        }
        for (int i = 1; i <= m; i++) {
            arr2[i] = sc.nextInt();
            arr2_index[i][1] = arr2[i];
            arr2_index[i][0] = 1;
        }

//        Arrays.sort(arr1);
//        Arrays.sort(arr2);

        int[] res = new int[n+1];

        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= m; j++) {
//                System.out.println(arr2_index[j][0]);
//                System.out.println(arr2_index[j][1]);

                if(arr2_index[j][0] > arr1[i] || arr2_index[j][0]>arr2_index[j][1]){
                    continue;
                }else{
                    if(arr1[i] >= arr2_index[j][1]){
                        res[i]+= arr2_index[j][1] - arr2_index[j][0]+1;
                        arr2_index[j][0] = arr2_index[j][1]+1;
                        System.out.println("第"+i+"个人挖掉身高内第"+j+"个矿");
                    }else{
                        res[i]+= arr1[i]-arr2_index[j][0]+1;
                        arr2_index[j][0] = arr1[i]+1;
                        System.out.println("第"+i+"个人挖掉第"+j+"个矿所有的");
                    }
                }
            }
        }
        for (int i = 1; i <= n; i++) {
            System.out.print(res[i] + " ");
        }
    }

}